import { useState } from 'react';
import { YmDialog } from 'ym-design';

function YmDialogPage2() {
  const [visible1, setVisible1] = useState<boolean>(false);
  const onClose1 = () => {
    setVisible1(false);
  };
  return (
    <div>
      <p>
        <button
          type="button"
          onClick={() => {
            setVisible1(true);
          }}
        >
          打开dialog
        </button>
      </p>
      <YmDialog
        width={400}
        open={visible1}
        onClose={onClose1}
        onCancel={onClose1}
        onOk={onClose1}
        title="dialog2"
        destroyOnClose={false}
        forceRender={false}
        footer={null}
      >
        <input autoFocus />
        <p>dialog 2</p>
      </YmDialog>
    </div>
  );
}

export default YmDialogPage2;
